<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>${person.firstName} ${person.lastName}</title>
    <script type="text/javascript" src="/voteup/resources/js/jquery-1.6.1.js"></script>
    <script type="text/javascript" src="/voteup/resources/js/stylescript.js"></script>
</head>
<body>
<c:import url="/WEB-INF/jsp/header.jsp"/>
<c:import url="/WEB-INF/jsp/menu.jsp"/>
<table class="personavatarinfotable" cellspacing="0" cellpadding="4">
    <tr>
        <td align=center>
            <img src="/voteup/resources/img/avatars/${person.avatar}.jpg" alt="" width="120" height="160"
                 class="avatar">

            <p class="rate">${person.rating}</p>
            <c:if test="${addvote}">
                <form action="/voteup/persons/${person.personId}/addvote" method="POST">
                    <input type="button" class="inputbutton" name="persontoid" value="Vote up" onclick="submit();">
                </form>
            </c:if>
            <c:if test="${not addvote}">
                <form action="/voteup/persons/${person.personId}/deletevote" method="POST">
                    <input type="button" class="inputbutton" name="persontoid" value="Unvote" onclick="submit();">
                </form>
            </c:if>
            <p class="rate"><a href="/voteup/messages/sendmessage?id=${person.personId}">Send message
                to ${person.firstName}</a></p>
            <c:if test="${addfriend}">
                <p class="rate"><a href="/voteup/persons/${person.personId}/addfriend">Add to friends</a></p>
            </c:if>
            <c:if test="${(not addfriend) and (not confirmed)}">
                <p class="rate">Waiting for friendship</p>
            </c:if>
            <c:if test="${confirmed}">
                <p class="rate"><a href="/voteup/persons/${person.personId}/deletefriend">Delete from friends</a></p>
            </c:if>
        </td>
        <td valign="top">
            <table class="persontable" cellspacing="0" cellpadding="4">
                <tr>
                    <td><p>Name: ${person.lastName} ${person.firstName} ${person.middleName}</p></td>
                </tr>
                <tr>
                    <td><p>Bitrhday: ${person.bday}-${person.bmonth}-${person.byear}</p></td>
                </tr>
                <tr>
                    <td><p>Student of: <a
                            href="/voteup/universities/${person.group.faculty.university.universityId}">${person.group.faculty.university.universityName}</a>
                    </p></td>
                </tr>
                <tr>
                    <td><p>Faculty: <a
                            href="/voteup/faculties/${person.group.faculty.facultyId}">${person.group.faculty.facultyName}</a>
                    </p>
                    </td>
                </tr>
                <tr>
                    <td><p>Group: <a href="/voteup/groups/${person.group.groupId}">${person.group.groupName}</a></p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</body>
</html>